/*
 * treasure.hpp
 *
 *  Created on: Aug 19, 2013
 *      Author: jason
 */

#ifndef TREASURE_HPP_
#define TREASURE_HPP_

#include <SFML/Graphics.hpp>
#include <vector>
#include "Characters.hpp"
#include "../Items/Items.hpp"
#include "../GlobalState.hpp"
#include "../GUI/GUIManager.hpp"

namespace OForce_Object {
// Treasures will only ever hold one item or gold
class Treasure : public Object {
public:
	Treasure(int posX, int posY, int gold, int id, int itemID, int open = 0,
			int hidden = 0);
	~Treasure();
	// all interactable objects should have an interact function
	void open(Character *actor);
	bool isOpen() {return mOpen;}
	int getGold() {return mGold;}
	int getItemID() {return mId;}
	OForce::Item *getItem() {return mItem;}
	sf::Vector2i getPosition() {return position;}
	void hurry();
	bool finishedTyping() {return dialogueWindow.finishedTyping();}
	void draw();
	void drawDialogue();
	void setEmpty(bool e = true) {mEmpty = e;}
	void update();
private:
	bool mOpen;
	bool mHidden;
	bool mEmpty;
	int mGold;
	OForce::Item *mItem;
	sf::Text windowText;
	sf::Sprite windowSprite;
	sf::Image windowImage;
	sf::Texture windowTexture;
	OForce_UI::DialogueWindow dialogueWindow;
	void openChest(bool open) {mOpen = open;}
};

} // namespace OForce_Object

#endif /* TREASURE_HPP_ */
